package com.aaa.account.controller;

import com.aaa.account.entity.Manager;
import com.aaa.account.entity.TbAccAccount;
import com.aaa.account.service.impl.ManagerServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("manager")
public class ManagerController {

    @Resource
    ManagerServiceImpl managerServiceImpl;

    @RequestMapping("selectAll")
    public List<Manager> selectAll(){
        return managerServiceImpl.listDesc();
    }

    @RequestMapping("saveOrUpdate")
    public boolean saveOrUpdate(Manager manager){
        return managerServiceImpl.saveManager(manager);
    }

    //模糊查询
    @RequestMapping("listByUsername")
    public List<Manager> listByUsername(String username){
        return managerServiceImpl.listByUsername(username);
    }
}
